{template block/header}
<script src="{$statics_path}js/ajaxfileupload.js" type="text/javascript"></script>
<div id="bodywrap">
    <table class="layout">
        <tr>
            <td class="left">
                <div class="mainbody" id="setting_layout">
					{template setting/setting_menu}
                    <div class="innercol">
                            <div class="innerconetent">
                                <form id="setting_basic_form" action="{link ctl=setting act=save_display}" method="post" onsubmit="return false;">
                                    <div class="settingfield">
                                        <div class="label">{lang site_logo_label}</div>
                                        <div class="descinfo">{lang site_logo_tips}</div>
                                        <div class="input">
                                            <input type="text" id="logo_img" name="site[logo]" class="settinginput iptw3" value="{if isset($site['logo'])}{$site['logo']}{/if}" />
                                            <a href="javascript:void(0)" onclick="upload_logo()">{lang upload}</a>
                                        </div>
                                    </div>
                                    <div class="settingfield">
                                        <div class="label">{lang site_footer_label}</div>
                                        <div class="descinfo">{lang site_footer_tips}</div>
                                        <div class="input">
                                            <textarea name="site[footer]" class="settinginput iptw5 ipth1">{$site['footer']}</textarea>
                                        </div>
                                    </div>
                                    <div class="settingfield">
                                        <div class="label">{lang show_process_info_label}</div>
                                        <div class="descinfo">{lang show_process_info_tips}</div>
                                        <div class="input">
                                            <label><input type="checkbox" name="show_process_info" value="1" {if $show_process_info}checked="checked"{/if} /> {lang enable}</label>
                                        </div>
                                    </div>

                                    <div class="settingfield">
                                        <div class="label">{lang album_sort_default_label}</div>
                                        <div class="input">
                                            <select name="display[album_sort_default]">
												{loop $album_sort_list $key $value}
												<option value="{$value}_desc" {if $album_sort_default==$value."_desc"}selected="selected"{/if}>{$key}-{lang desc}</option>
												<option value="{$value}_asc" {if $album_sort_default==$value."_asc"}selected="selected"{/if}>{$key}-{lang asc}</option>
												{/loop}
											</select>
                                        </div>
                                    </div>
									<div class="settingfield">
                                        <div class="label">{lang album_pageset_label}</div>
                                        <div class="input">
                                            <select name="display[album_pageset]">
												<option value="12" {if $album_pageset==12}selected="selected"{/if}>12</option>
												<option value="30" {if $album_pageset==30}selected="selected"{/if}>30</option>
												<option value="56" {if $album_pageset==56}selected="selected"{/if}>56</option>
											</select>
                                        </div>
                                    </div>
									<div class="settingfield">
                                        <div class="label">{lang photo_sort_default_label}</div>
                                        <div class="input">
                                            <select name="display[photo_sort_default]">
												{loop $photo_sort_list $key $value}
												<option value="{$value}_desc" {if $photo_sort_default==$value."_desc"}selected="selected"{/if}>{$key}-{lang desc}</option>
												<option value="{$value}_asc" {if $photo_sort_default==$value."_asc"}selected="selected"{/if}>{$key}-{lang asc}</option>
												{/loop}
											</select>
                                        </div>
                                    </div>
                                    <div class="settingfield">
                                        <div class="label">{lang photo_pageset_label}</div>
                                        <div class="input">
                                            <select name="display[photo_pageset]">
												<option value="12" {if $photo_pageset==12}selected="selected"{/if}>12</option>
												<option value="30" {if $photo_pageset==30}selected="selected"{/if}>30</option>
												<option value="56" {if $photo_pageset==56}selected="selected"{/if}>56</option>
											</select>
                                        </div>
                                    </div>
                                    
                                    <div class="ctl_button">
                                        <input type="submit" name="submit" class="ylbtn" value="{lang save_setting}" onclick="Mui.form.sendPop('setting_basic_form')" />
                                    </div>
                                </form>
                            </div>
                    </div>
                </div>
            </td>
        </tr>
    </table>
</div>
<script>
function upload_logo(){
    var newuploadwin = '<div class="box_title titbg"><div onclick="Mui.box.close()" class="closer sprite i_close"></div>{lang upload}</div><div class="box_container"><input id="fileToUpload" type="file" size="25" name="fileToUpload"> <button class="ylbtn1" id="buttonUpload" onclick="return ajaxFileUpload();">{lang upload}</button> <input class="ylbtn1" type="button" value="{lang cancel}" onclick="Mui.box.close();" /></div>';
    Mui.box.setData(newuploadwin,true);
}

function ajaxFileUpload(){
    $.ajaxFileUpload
    (
        {
            url:'{link ctl=setting act=fileupload}',
            secureuri:false,
            fileElementId:'fileToUpload',
            dataType: 'json',
            data:{upaction:'logo'},
            success: function (data, status)
            {
                if(typeof(data.error) != 'undefined'){
                    if(data.error != ''){
                        alert(data.error);
                    }else{
                        $('#logo_img').val(data.msg);
                        Mui.box.close();
                    }
                }
            },
            error: function (data, status, e){
                alert(e);
            }
        }
    )
    
    return false;
    
}
</script>
{template block/footer}